﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using VOL.Core.Utilities;
using VOL.Entity.AttributeManager;
using VOL.SmartMecial.Dtos;
using VOL.SmartMecial.IServices.NurseManage;

namespace VOL.WebApi.Controllers.SmartMecial
{
    [Route("api/NurseManageController")]
    [PermissionTable(Name = "NurseManageController")]
    public class NurseManageController : ControllerBase
    {
        private readonly IOtherPorterWorkDetail services;
        private readonly IPatientServices patientServices;

        public NurseManageController(IOtherPorterWorkDetail services, IPatientServices patientServices)
        {
            this.services = services;
            this.patientServices = patientServices;
        }

        [HttpPost("AddPorterWorkDetail")]
        public async Task<WebResponseContent> AddPorterWorkDetail([FromBody] Entity.DomainModels.PorterWorkDetail porterWorkDetail)
        {
            var result = await services.AddPorterWorkDetail(porterWorkDetail);
            var webResponseContent = WebResponseContent.Instance.OK(null, result);
            return webResponseContent;
        }

        [HttpGet("ShowPorterWorkDetail")]
        public async Task<WebResponseContent> ShowPorterWorkDetail(PageDTO pageDto)
        { 
            var result = await services.ShowPorterWorkDetail(pageDto);
            var webResponseContent = WebResponseContent.Instance.OK(null, result);
            return webResponseContent;
        }

        [HttpGet("ShowPatient")]
        public async Task<WebResponseContent> ShowPatient()
        {
            var result = await patientServices.ShowPatient();
            var webResponseContent = WebResponseContent.Instance.OK(null, result);
            return webResponseContent;
        }

    }
}
